/**
 * 
 */
package fr.gfi.agraf.vue.bean;

/**
 * @author Zakaria
 *
 */
public class ComposantDTO {

	private Long id;

	private String libelle;

	private String nomAction;

	/**
	 * Permet de pre-selectionner les composants déjà associés
	 */
	private boolean isChecked;

	private CategorieComposantDTO categorieComposantDTO;

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null || getClass() != obj.getClass()) {
			return false;
		}
		final ComposantDTO composant = (ComposantDTO) obj;
		if (!composant.getId().equals(this.getId())) {
			return false;
		}

		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		if (id == null || id == 0) {
			return super.hashCode();
		}
		return (int) (7 * id);
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(final Long id) {
		this.id = id;
	}

	/**
	 * @return the libelle
	 */
	public String getLibelle() {
		return libelle;
	}

	/**
	 * @param libelle
	 *            the libelle to set
	 */
	public void setLibelle(final String libelle) {
		this.libelle = libelle;
	}

	/**
	 * @return the nomAction
	 */
	public String getNomAction() {
		return nomAction;
	}

	/**
	 * @param nomAction
	 *            the nomAction to set
	 */
	public void setNomAction(String nomAction) {
		this.nomAction = nomAction;
	}

	/**
	 * @return the categorieComposantDTO
	 */
	public CategorieComposantDTO getCategorieComposantDTO() {
		return categorieComposantDTO;
	}

	/**
	 * @param categorieComposantDTO
	 *            the categorieComposantDTO to set
	 */
	public void setCategorieComposantDTO(
			CategorieComposantDTO categorieComposantDTO) {
		this.categorieComposantDTO = categorieComposantDTO;
	}

	/**
	 * @return the isChecked
	 */
	public boolean isChecked() {
		return isChecked;
	}

	/**
	 * @param isChecked
	 *            the isChecked to set
	 */
	public void setChecked(final boolean isChecked) {
		this.isChecked = isChecked;
	}

}
